<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var money = 100
        function fn(money,n,rate){
            console.log('准备金率:' + rate);
            //money原始值
            var total = 0;
            for(var i=0;i<=n;i++){
                var one = money
                for(var j=0;j<i;j++){
                    one *=  (1-rate)
                }
                total += one
            }
            return total
        }
        console.log(fn(money,200,0.015));
        //1%————>86.74
        //1.5%————>63.47
        //2%—————>49.13
        //3%————>33.26
        //4%————>25
        //5%————>20
        //10%————>10
        //20%————>5
        //25%————>4

    </script>
</body>
</html>